package com.d0330;

public class Account {
    private String accountid;
    private String password;
    private double balance;

    public Account() {
        super();
    }

    public Account(String accountid, String password, double balance) {
        super();
        this.accountid = accountid;
        this.password = password;
        this.balance = balance;
    }

    public String getAccountid() {
        return accountid;
    }

    public void setAccountid(String accountid) {
        this.accountid = accountid;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }
    public Double save(Double amount){
        balance=balance+amount;
        return balance;
    }
    public Double pay(Double amount){
        balance=balance-amount;
        return balance;
    }
    @Override
    public String toString() {
        return "Account [accountid=" + accountid + ", password=" + password + ", balance=" + balance + "]";
    }
}
